<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>
        <ui:composition template="./template.xhtml">
            <ui:define name="navigation">
                <ul>
                    <li><h:link value="#{msg.changeUserData}" outcome="index"/></li>
                    <li><h:link value="#{msg.backToLounge}" outcome="index"/></li>
                    <li><h:link value="#{msg.logout}" outcome="index"/></li>                  
                </ul>
            </ui:define>
            <ui:define name="content">  
                <div id="info_area">
                    
                    <!--
                    <% if (!gameBean.isInProgress()) { %>
                    <form action="MenschServlet" method="post">
                        <input type="submit" value="Restart Game" />
                    </form>
                    <% } %>
                    -->
                    
                    <h2>Spielinformationen</h2>
                    <table class="game_info" summary="Diese Tabelle zeigt Informationen zum aktuellen Spiel">
                        <tbody>
                            <tr class="accessibility">
                                <th>Information</th>
                                <th>Wert</th>
                            </tr>
                            <tr>
                                <th>Anzahl Spieler</th>
                                <td><h:outputText value="#{gameBean.numberOfPlayers}" /></td>
                            </tr>
                            <tr>
                                <th>F&uuml;hrender</th>
                                <td><h:outputText value="#{gameBean.leaderName}" /></td>
                            </tr>
                            <tr>
                                <th>Aktuelle Runde</th>
                                <td><h:outputText value="#{gameBean.currentRound}" /></td>
                            </tr>
                            <tr>
                                <th>Zeit</th>
                                <td><h:outputText value="#{gameBean.time}" /></td>
                            </tr>
                        </tbody>
                    </table>
                    
                    <h2>Spieler</h2>
                    <table class="game_info" summary="Diese Tabelle listet die Namen der Spieler auf">
                        <tbody>
                            <tr class="accessibility">
                                <th>Spielernummer</th>
                                <th>Spielername</th>
                            </tr>

                            <ui:repeat value="#{gameBean.players}" var="player">
                            <!--<% for (int i=0; i<gameBean.getNumberOfPlayers(); i++) { %> -->
                                <tr>
                                    <th>Spieler #{player.playerID}</th>
                                    <td><h:outputText value="#{player.username}" /></td>
                                </tr>
                            <!--    <% } %>-->
                            </ui:repeat>
                        </tbody>
                    </table>
                </div>
                
                <div id="dicearea">
                    <hr class="accessibility" />
                    <h2 class="accessibility">W&uuml;rfel</h2>
                    <span title='aktueller Spieler'><h:outputText value="#{gameBean.playerName}" /></span>
                    
                    <!--
                    <%if (gameBean.isInProgress()) { %><a href="MenschServlet?action=roll"><% } %><img name="wuerfel" title="W&uuml;rfel Zahl <%=gameBean.getCurrentDiceValue() %>" src="img/wuerfel<%=gameBean.getCurrentDiceValue() %>.png" alt="W&uuml;rfel Zahl <%=gameBean.getCurrentDiceValue() %>"/><%if (gameBean.isInProgress()) { %></a><% } %>
                    -->
                </div>
                
                <!--
                <div id="play_area">
                    <hr class="accessibility" />
                    <div id="board">
                        <h2 class="accessibility">Spielbrett</h2>
                        <div class="fields">
                            <h3 class="accessibility">Spielfelder</h3>
                            <ol title="Spielfelder">
                                <% for (int i=0; i<40; i++) { %>
                                <li><img id='field<%=i+1 %>' src='img/<%=gameBean.getFieldImageFilename(i) %>' alt='<%=gameBean.getFieldTitle(i) %>' title='<%=gameBean.getFieldTitle(i) %>' /></li>
                                <% } %>
                            </ol>

                            <h3 class="accessibility">Starth&auml;user</h3>
                            <% for (int j=0; j<4; j++) { %>
                            <ol title="Starthaus Spieler <%= j+1%>">
                                <% for (int i=40+j*4; i<44+j*4; i++) { %>
                                <li><img id='field<%=i+1 %>' src='img/<%=gameBean.getFieldImageFilename(i) %>' alt='<%=gameBean.getFieldTitle(i) %>' title='<%=gameBean.getFieldTitle(i) %>' /></li>
                                <% } %>
                            </ol>
                            <% } %>

                            <h3 class="accessibility">Zielh&auml;user</h3>
                            <% for (int j=0; j<4; j++) { %>
                            <ol title="Zielhaus Spieler <%= j+1%>">
                                <% for (int i=56+j*4; i<60+j*4; i++) { %>
                                <li><img id='field<%=i+1 %>' src='img/<%=gameBean.getFieldImageFilename(i) %>' alt='<%=gameBean.getFieldTitle(i) %>' title='<%=gameBean.getFieldTitle(i) %>' /></li>
                                <% } %>
                            </ol>
                            <% } %>
                        </div>
                        <div class="clearer"></div>  
                        <div id="infogegner">W&uuml;rfelergebnis Computer: <%=gameBean.getRecentDiceValues() %></div>
                    </div>
                </div>
                -->
                
            </ui:define>
        </ui:composition>
    </body>
</html>